<?php

namespace IDock\Insurance\AICS\Request;

use Exception;
use IDock\Insurance\AICS\Request\AllAICSRequest;
use IDock\Insurance\AICS\Response\ProposalRecallResponse;
use IDock\Visitor\ProposalRecallVisitor;

class ProposalRecallRequest extends AllAICSRequest
{
    public $code = 'returnAppPolicyWebService';

    public $envelopeName = 'new:returnAppPolicy';

    protected $response = ProposalRecallResponse::class;

    protected $urlTip = '核保撤回';

    /**
     * @var ProposalRecallVisitor $visitor
     */
    protected $visitor;

    /**
     * @return array
     * @throws Exception
     */
    public function generate(): array
    {
        $param = [
            'condition' => [
                'appno' => $this->visitor->ciInquiryNo,
                'deptcode' => $this->visitor->argc['CDptCde'] ?? '',
                'operatorcode' => $this->visitor->argc['operatorCode'] ?? '',
            ]
        ];

        return $param;
    }
}
